/**
 * Created by sunkejun on 2015/10/15.
 */
var openToastr  = (function ($) {
    //...
    var U = {};
    U.open = function(type,title,msg){
        toastr.options = {
            "closeButton": true,
            "debug": false,
            "progressBar": true,
            "preventDuplicates": false,
            "positionClass": "toast-top-right",
            "onclick": null,
            "showDuration": "400",
            "hideDuration": "1000",
            "timeOut": "3000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        }
        console.log(title,msg);
        var types = ["warning","success","info","error"];
        toastr[types[type>types.length?types.length-1:type]](title, "");
    }
    return U;
})(jQuery);